home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: Tradition or what?
- Date: 14 Feb 1996 18:43:32 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4fu6kkINNmea@keats.ugrad.cs.ubc.ca>
- References: <1996Feb13.115611.73989@cc.usu.edu>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <1996Feb13.115611.73989@cc.usu.edu>,
- Erik van Renselaar <erik@cc.usu.edu> wrote:
- >Hi all,
- >
- >Can anyone tell me what the use is of returning
- >the same value for the function and one of the
- >output parameters, like it is done in strcpy?
- >Why return a string for the function if the
- >result is in its first parameter as well?
- >
- >Is this just tradition or is it actually useful
- >for anything?
-
- Of course it is useful. It establishes the function as an expression, an
- rvalue. Thus you can nest it, and do something like>
-
- if (!strcmp(strcpy(s1,s2),s3)) {
- /* ... */
- }
-
-
- >Erik
-
-
- --
-
-